import requests
from requests.auth import HTTPDigestAuth

# 请求的URL
url = 'http://192.168.50.187/digest/frmAudioSpeech'

# 请求头
headers = {
    'Content-Type': 'application/json',
    'User-Agent': 'curl/4.7.1',
    'Cache-Control': 'no-cache',
    'Postman-Token': 'cfdf0937-f7a5-4b79-8c39-42eb232d4c0b',
}
# 请求体
data = {
    "Type": 1,
    "Dev":1,
    "Ch": 1,
    "Data": {
            "DetectType": 9,
            "AudioSelected": 1
    }
}

# HTTP Digest认证信息
username = 'admin'
password = '123456'  # 密码通常需要填写，但在此示例中未提供

# 发送请求
response = requests.post(url, json=data, headers=headers, auth=HTTPDigestAuth(username, password))
print(response.text)
print(response.status_code)
